package com.ruoyi.system.service.impl;

import java.util.List;
import com.ruoyi.common.core.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.system.mapper.PUserAddressMapper;
import com.ruoyi.system.domain.PUserAddress;
import com.ruoyi.system.service.IPUserAddressService;

/**
 * 微信用户地址Service业务层处理
 * 
 * @author ruoyi
 * @date 2024-01-28
 */
@Service
public class PUserAddressServiceImpl implements IPUserAddressService 
{
    @Autowired
    private PUserAddressMapper pUserAddressMapper;

    /**
     * 查询微信用户地址
     * 
     * @param id 微信用户地址主键
     * @return 微信用户地址
     */
    @Override
    public PUserAddress selectPUserAddressById(Long id)
    {
        return pUserAddressMapper.selectPUserAddressById(id);
    }

    /**
     * 查询微信用户地址列表
     * 
     * @param pUserAddress 微信用户地址
     * @return 微信用户地址
     */
    @Override
    public List<PUserAddress> selectPUserAddressList(PUserAddress pUserAddress)
    {
        return pUserAddressMapper.selectPUserAddressList(pUserAddress);
    }

    /**
     * 新增微信用户地址
     * 
     * @param pUserAddress 微信用户地址
     * @return 结果
     */
    @Override
    public int insertPUserAddress(PUserAddress pUserAddress)
    {
        pUserAddress.setCreateTime(DateUtils.getNowDate());
        return pUserAddressMapper.insertPUserAddress(pUserAddress);
    }

    /**
     * 修改微信用户地址
     * 
     * @param pUserAddress 微信用户地址
     * @return 结果
     */
    @Override
    public int updatePUserAddress(PUserAddress pUserAddress)
    {
        pUserAddress.setUpdateTime(DateUtils.getNowDate());
        return pUserAddressMapper.updatePUserAddress(pUserAddress);
    }

    /**
     * 批量删除微信用户地址
     * 
     * @param ids 需要删除的微信用户地址主键
     * @return 结果
     */
    @Override
    public int deletePUserAddressByIds(Long[] ids)
    {
        return pUserAddressMapper.deletePUserAddressByIds(ids);
    }

    /**
     * 删除微信用户地址信息
     * 
     * @param id 微信用户地址主键
     * @return 结果
     */
    @Override
    public int deletePUserAddressById(Long id)
    {
        return pUserAddressMapper.deletePUserAddressById(id);
    }
}
